﻿using System.Drawing;
using System.IO;
using PlanningGIS.Framework;
using ESRI.ArcGIS.ADF.BaseClasses;
using PlanningGIS.CoordCovert.form;

namespace PlanningGIS.CoordCovert.button
{
   
    internal class btnProGroCoordConvert : BaseCommand
    {
        FrmProGroCoordConvert myform;
        IApplication m_Application = null;
        public btnProGroCoordConvert()
        {
            base.m_caption = "高斯投影反算";
            base.m_toolTip = base.m_caption;
        }

        public override void OnCreate(object hook)
        {
            if (m_Application == null)  
            {
                m_Application = hook as IApplication;
            }
        }


        public override bool Enabled
        {
            get
            {
                if (m_Application == null)
                    return false;
                return (m_Application as IFramework).IsMapCtrlactive;
            }
        }

        public override void OnClick()
        {
            if ((m_Application as IFramework).IsMapCtrlactive)
            {
                if (myform == null || myform.IsDisposed)
                {
                    myform = new FrmProGroCoordConvert();
                }
                myform.Visible = false;
                myform.Show((m_Application as IFramework).MdiForm);
            }
        }

        //public override int Bitmap
        //{
        //    get
        //    {
        //        string bitmapResourceName = this.GetType().Namespace + ".Res." + this.GetType().Name + ".png";
        //        return new Bitmap(GetType().Assembly.GetManifestResourceStream(bitmapResourceName)).GetHbitmap().ToInt32();
        //    }

        //}
    }
}